Skip to content

Support library-style tests - #111

Open
bryantaustin13 wants to merge 1 commit into
cqframework:mainfrom
bryantaustin13:library-test-support
Open

Support library-style tests#111
bryantaustin13 wants to merge 1 commit into
cqframework:mainfrom
bryantaustin13:library-test-support

Conversation

@bryantaustin13

Copy link
Copy Markdown
Contributor

Summary

Adds runner support for tests that provide a full CQL <library> and a named
<output>, complementing the schema change in cqframework/cql-tests#141.
Enables cqframework/cql-tests#61 to actually execute, and is the runner side of
cqframework/cql-tests#17.

Changes

  • models/test-types.ts: add TestLibrary; make expression optional; add
    library and TestOutput.name.
  • shared/results-shared.ts: build a Result from a library test (evaluates the
    define named by <output name>, defaulting to output) and pass the library
    inline via the $cql content parameter.
  • commands/build-cql-command.ts: skip library tests (they are evaluated inline,
    not wrapped as generated define statements).

Wire format

The cqframework $cql operation accepts the whole library as a top-level
content (string) parameter plus expression = the unqualified define name;
it returns the result keyed by that define name. (HL7 base $cql only references
libraries by URL; this uses the cqframework inline-content extension.)

⚠️ Authoring note (engine caching)

The engine caches inline libraries by name + version, so every
library-style test must declare a unique library name
or a stale compiled
copy is returned. Discovered while validating; flagging for test authors. A
future hardening could auto-uniquify the name/version per test.

Validation

tsc --noEmit clean; ran the runner against #61's file →
SimpleOverloadMatching status: pass.

Relationship to other work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant